package com.william.jdbcplus.test.entity;

import com.william.jdbcplus.common.annotation.*;
import com.william.jdbcplus.common.entity.Entity;
import com.william.jdbcplus.common.enums.IdType;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 用户表
 *
 * @author niliwei
 */
@Data
@NoArgsConstructor
@Table("db_user")
@ApiModel("用户表")
public class DbUser implements Entity {
    @TableId(value = "id", remarks = "主键", type = IdType.GUID)
    private String id;

    @TableColumn(remarks = "用户编码", nullable = false)
    private String userCode;

    @TableColumn(remarks = "机构编码", nullable = false)
    @TableFinal
    @TableFk(pkEntity = DbOrg.class, pkField = "code")
    private String orgCode;

    @TableColumn(remarks = "登录账号", nullable = false)
    @TableUk
    private String account;

    @TableColumn(remarks = "登录名", nullable = false)
    private String name;

    @TableColumn(remarks = "登录密码", nullable = false)
    private String password;

    @TableColumn(remarks = "是否医院管理员")
    private Boolean isAdmin = false;

    @TableColumn(remarks = "手机号")
    private String phone;

    @TableColumn(remarks = "邮箱")
    private String email;
}

